# Update with: latex-process-inputs -makefilelist main.tex
TEX_FILES = \
main.tex \
abstract.tex \
introduction.tex \
contributions.tex \
dominator-modifier.tex \
oigj-language.tex \
oigj-list.tex \
oigj-rules.tex \
formal.tex \
case-studies.tex \
related-work.tex \
conclusions.tex

EPS_FIGURES = \
owners-and-immutability-params.eps \
school.eps

PDF_FIGURES = $(patsubst %.eps,%.pdf,${EPS_FIGURES})

.PHONY: all pdf
all: pdf tr
pdf: main.pdf

main.bbl: ${TEX_FILES} bib-update
	latex main
	bibtex main

main.dvi: ${TEX_FILES} ${EPS_FIGURES} main.bbl
	latex main
	latex main

main.pdf: main.dvi ${PDF_FIGURES} main.bbl
	pdflatex main
	pdflatex main

pdf-via-dvi: main.dvi
	dvipdfm main

www: main.pdf
	rm -f ~/www/tmp/main.pdf
	cp -f main.pdf ~/www/tmp

tags: TAGS
TAGS: ${TEX_FILES}
	etags ${TEX_FILES}
.PHONY: tags

%.pdf : %.eps
	epstopdf $<

export BIBINPUTS ?= .:bib

bib:
	hg clone https://plume-bib.googlecode.com/hg/ bib
.PHONY: bib-update
bib-update: bib
	cd bib && hg pull -u && make

tr: oigj-tech-report.tex
	pdflatex oigj-tech-report
